import 'package:flutter_kit_dsp/flutter_kit_dsp.dart';

import 'search.dart';

class MyInputController extends SumController {
  RxList<String> items = ['CH 1/2', 'CH 3/4', 'CH 1/2/3/4', 'Bluetooth'].obs;
  int _oldItem = 0;
  RxInt currentItem = 0.obs;
  RxBool ison = true.obs;
  @override
  void onInit() {
    currentItem.value = 0;
    ison.value = globalController.rxModel.value.mute;
    super.onInit();
  }

  void turnVoice() {
    globalController.updateMUTEALL();
    ison.value = globalController.rxModel.value.mute;
  }

  void updateDB(db, {bool issend = false}) {
    globalController.updateDBALL(db, isSend: issend);
  }

  void selectionTag(int index, BuildContext context) {
    currentItem.value = index;
    switch (index) {
      case 0:
        break;
      case 1:
        break;
      case 2:
        break;
      case 3:
        final search = SearchView();
        search.show(context, completion: () => currentItem.value = _oldItem);
        return;
      default:
    }
    _oldItem = index;
  }
}
